package com.jiuqi.irs.generator.form;

import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for tbApplicationDetail.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="tbApplicationDetailForm"
 */
public class TbApplicationDetailForm extends ActionForm {

	private final static SimpleDateFormat FORMAT = new SimpleDateFormat(
			"dd.MM.yyyy hh:mm:ss");

	private java.lang.String detailGuid = null;

	private java.lang.String applaGuid = null;

	private java.lang.String orgGuid = null;

	private java.lang.String buyCardNo = null;

	private java.lang.String year;

	private java.lang.String startnumber;

	private java.lang.String endnumber;

	private java.lang.String reccreator;

	private java.lang.String accordTime;

	private java.lang.String quantity = null;

	private java.lang.String reserved1 = null;

	private java.lang.String reserved2 = null;

	private java.lang.String reserved3 = null;

	/**
	 * Standard constructor.
	 */
	public TbApplicationDetailForm() {

	}

	public java.lang.String getDetailGuid() {
		return detailGuid;
	}

	public void setDetailGuid(java.lang.String detailGuid) {
		this.detailGuid = detailGuid;
	}

	public java.lang.String getYear() {
		return year;
	}

	public void setYear(java.lang.String year) {
		this.year = year;
	}

	public java.lang.String getStartnumber() {
		return startnumber;
	}

	public void setStartnumber(java.lang.String startnumber) {
		this.startnumber = startnumber;
	}

	public java.lang.String getEndnumber() {
		return endnumber;
	}

	public void setEndnumber(java.lang.String endnumber) {
		this.endnumber = endnumber;
	}

	public java.lang.String getReccreator() {
		return reccreator;
	}

	public void setReccreator(java.lang.String reccreator) {
		this.reccreator = reccreator;
	}

	public java.lang.String getAccordTime() {
		return accordTime;
	}

	public void setAccordTime(java.lang.String accordTime) {
		this.accordTime = accordTime;
	}

	public java.lang.String getApplaGuid() {
		return applaGuid;
	}

	public void setApplaGuid(java.lang.String applaGuid) {
		this.applaGuid = applaGuid;
	}

	public java.lang.String getOrgGuid() {
		return orgGuid;
	}

	public void setOrgGuid(java.lang.String orgGuid) {
		this.orgGuid = orgGuid;
	}

	public java.lang.String getQuantity() {
		return quantity;
	}

	public void setQuantity(java.lang.String quantity) {
		this.quantity = quantity;
	}

	public java.lang.String getBuyCardNo() {
		return buyCardNo;
	}

	public void setBuyCardNo(java.lang.String buyCardNo) {
		this.buyCardNo = buyCardNo;
	}

	public java.lang.String getReserved1() {
		return reserved1;
	}

	public void setReserved1(java.lang.String reserved1) {
		this.reserved1 = reserved1;
	}

	public java.lang.String getReserved2() {
		return reserved2;
	}

	public void setReserved2(java.lang.String reserved2) {
		this.reserved2 = reserved2;
	}

	public java.lang.String getReserved3() {
		return reserved3;
	}

	public void setReserved3(java.lang.String reserved3) {
		this.reserved3 = reserved3;
	}

	public static SimpleDateFormat getFormat() {
		return FORMAT;
	}

	/**
	 * Validate the properties that have been set from this HTTP request,
	 * and return an <code>ActionErrors</code> object that encapsulates any
	 * validation errors that have been found.  If no errors are found, return
	 * <code>null</code> or an <code>ActionErrors</code> object with no
	 * recorded error messages.
	 *
	 * @param mapping The mapping used to select this instance
	 * @param request The servlet request we are processing
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		// test for nullity
		if (getDetailGuid() == null) {
			errors.add("detailGuid", new ActionError(
					"error.detailGuid.required"));
		}
		// TODO test format/data
		return errors;
	}
}
